package com.lecloud.api.connect;

import java.util.Map;

import cn.edu.live.util.TimeUtil;

import com.alibaba.fastjson.JSONObject;
import com.lecloud.constant.Const;
import com.lecloud.model.PublicParam;
import com.lecloud.util.LeCloudVerify;
import com.lecloud.util.Sender;

/**
 * 打点录制创建任务接口（ver=4.0）</br> 功能说明：创建打点录制任务。 原画码率作为输入码率，直播上的码率作为输出码率，执行转码获取打点录制任务。
 * 
 * @author zhagz
 * 
 */
public class CreateRecTask {
	private static final String createRecTask_method = "lecloud.cloudlive.rec.createRecTask";
	private static final String createRecTask_ver = "4.0";

	public JSONObject createRecTask(String activityId, long startTime, long endTime) {
		Map<String, String> map = PublicParam.getPublicParamMap(createRecTask_method, createRecTask_ver, Const.userid,
				TimeUtil.currentTime());
		map.put("activityId", activityId);
		map.put("startTime", startTime + "");
		map.put("endTime", endTime + "");

		String sign = LeCloudVerify.getSign(map);
		map.put("sign", sign);
		JSONObject js = Sender.get(Const.common_url, map);

		return js;
	}
}
